package com.chdwmp.product.controller;

import com.chdwmp.product.bean.CommonResponse;
import com.chdwmp.product.bean.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

/**
 * @Auther: LLL
 * @Date: 2021/3/14 21:26
 * @Description: 测试的controller
 */
@Api(description = "测试模块", tags = {"测试模块接口控制层"})
@RequestMapping("/test")
@RestController
public class TestController {


    @GetMapping("/get/{id}")
    @ApiOperation(value = "测试get方法", httpMethod = "GET", response = CommonResponse.class)
    public CommonResponse testGet(@PathVariable String id) throws Exception {


        return new CommonResponse();
    }

    @PostMapping("/post")
    @ApiOperation(value = "测试post方法", httpMethod = "POST", response = CommonResponse.class)
    public CommonResponse testPost(@RequestBody User user) throws Exception {


        return new CommonResponse(user);
    }
}
